package Person;

import java.util.Scanner;

public class m02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        StringBuilder s = new StringBuilder();
        while(true){
         String str = sc.next();
         if(str.equals("end")){
             break;
         }else{
             if(str.length()%3==0){
                 s.append(str);
             }
         }
        }
        System.out.println(s);
    }
}
